package com.dymall.common.api;

import com.dymall.common.domain.dto.AddressDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("user-service")
public interface UserClient {
    @PutMapping("/users/money/deduct")
    void deductMoney(@RequestParam("pw") String pw, @RequestParam("amount") Integer amount);

    @GetMapping("/users/balance/{id}")
    Integer getBalance(@PathVariable("id") Long userId);

    @GetMapping("/addresses")
    List<AddressDTO> findMyAddresses();

    @GetMapping("/addresses/{addressId}")
    AddressDTO findAddressById(@PathVariable("addressId") Long id);
}
